package com.example.tictactoeandroid;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View; 
import android.widget.TextView;
import android.widget.Button; 
import io.InputOutput; 
import io.GUIInputOutput;
import game.*; 
import io.*; 


public class GameBoardActivity extends Activity {
	
	public int move; 

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_game_board);
		Intent intent = getIntent(); 
		String name = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); 
		System.out.println("name" + name); 
		TextView text = (TextView)findViewById(R.id.userNameInput); 
		System.out.println("text" + text); 
		text.setText(name); 
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.game_board, menu);
		return true;
	}
	
	public void setMove(View view){
		Button myButton = (Button)view; 
		String buttonText = "X"; 
		GUIInputOutput gui = new GUIInputOutput(); 
		gui.passMove(view); 
		gui.getMove(); 
		myButton.setText(buttonText); 
	}
}
